<h1 class="red">Job Listing</h1>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <th width="5%" bgcolor="#E0EBFC" scope="col">JobID</th>
    <th width="81%" bgcolor="#E0EBFC" scope="col">Job Title</th>
    <th width="14%" bgcolor="#E0EBFC" scope="col">Date/Time</th>
  </tr>
</table>
<?php
// Query to select data from table
$query = "SELECT * FROM jobs ORDER BY JobID DESC";
$result = mysql_query($query); 
// Check if we are able to select data from table
if (!$result) {
	echo "Unable to fetch any Job Listings, there maybe a problem with the database.";
} else {
	while($row = mysql_fetch_array($result)):
?>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5%" align="center" valign="middle"><?php echo $row['JobID']; ?></td>
    <td width="81%"><a href="viewjob.php?id=<?php echo $row['JobID']; ?>"><?php echo $row['JobTitle']; ?></a></td>
    <td width="14%"><?php echo $row['Timestamp']; ?></td>
  </tr>
</table>
<?php endwhile ?>
<?php } ?>
</p>